<template>
  <div>
    <el-input :modelValue="modelValue" @update:modelValue="handleInput"></el-input>
  </div>
</template>

<script>
import { ref } from 'vue'

export default {
  name: 'v-input',
  props: ["modelValue", "title"],
  setup (props, context) {
    let userName = ref(props.modelValue);
    const handleInput = (val) => {
      userName.value = val
      context.emit('update:modelValue', val);
    }
    const hanldeSubmit = (values) => {
      console.log(values)
    }

    return {
      userName,
      handleInput,
      hanldeSubmit,
    }
  }
}
</script>